





**************************Table C1******************************************************
**************************Table C1******************************************************
**************************Table C1******************************************************







*---------------------------------------------------------
*Part I nonexporters (def2): Columns 1, 3, 5, 7, 9, 11
*----------------------------------------------------------
cd "D:\Nanjing\2020\wage gap\Replication"   
use "labor-basic-tpu-reg-1.dta",clear
gen indc=1 if d_export==0
bysort newid: egen tot_num=sum(indc)
bysort newid t: gen ini_year=_n==1
gen ini_year2=t if ini_year==1
gen diff_year=2007-ini_year2+1
bysort newid: egen max_diff=max(diff_year)
keep if max_diff==tot_num  

      
* xtset newid t
 egen provyear=group(province  t)
 egen ind2year=group(ind2_adj  t)
 egen owneryear=group(QiuType  t)
 egen provowneryear=group(province QiuType  t)
 egen ind4year=group(ind4_adj  t)


gen lnabsG_gdp=ln(absG_gdp)

winsor2 tfp_op lnabsG_gdp lnage  finance2  lnkL rate , replace cuts(1 99) trim
*winsor2 lnRD, replace cuts(0 99) trim
drop if VMPL<0

*-------------------------------------------------------------------------------------
* Column 1:
reghdfe lnabsG_gdp  did   Llnl Ltfp_op  Llnage  LlnkL  LlnRD Lfinance2  ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provyear newid) cluster (ind4year)   

*-------------------------------------------------------------------------------------
* Column 3:
reghdfe lnabsG_gdp  did   Llnl Ltfp_op  Llnage  LlnkL  LlnRD Lfinance2  ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear newid) cluster (ind4year)   


*-------------------------------------------------------------------------------------
* Column 5:
reghdfe lnabsG_gdp  did   Llnl Ltfp_op  Llnage  LlnkL  LlnRD Lfinance2  ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear provyear newid) cluster (ind4year)   


*-------------------------------------------------------------------------------------
* Column 7:
reghdfe lnabsG_gdp  did   Llnl Ltfp_op  Llnage  LlnkL  LlnRD Lfinance2  ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provowneryear newid) cluster (ind4year)   


*-------------------------------------------------------------------------------------
*Column 9:
reghdfe lnabsG_gdp  did   Llnl Ltfp_op  Llnage  LlnkL  LlnRD Lfinance2  ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(ind2year provowneryear newid) cluster (ind4year)   


*-------------------------------------------------------------------------------------
***************************************
*Column 11 (continuing non-exporting firms)
capture drop n
gen n=1
bysort newid: egen tot_n=sum(n)
reghdfe lnabsG_gdp did  Llnl  Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind if tot_n==10,  ///
absorb(owneryear provyear newid) cluster (ind4year)   


************************************************************************************************************

*------------------------------------------------------------------
*Part II (Exporters): Columns 2, 4, 6 8, 10, 12
*------------------------------------------------------------------

cd "D:\Nanjing\2020\wage gap\Replication"   
use "labor-basic-tpu-reg-1.dta",clear
gen indc=1 if d_export==1 
bysort newid: egen tot_num=sum(indc)
bysort newid t: gen ini_year=_n==1
gen ini_year2=t if ini_year==1
gen diff_year=2007-ini_year2+1
bysort newid: egen max_diff=max(diff_year)
keep if max_diff==tot_num  

bysort newid: egen exp_max=max(export_intensity)
drop if exp_max==1         
* xtset newid t
 egen provyear=group(province  t)
 egen ind2year=group(ind2_adj  t)
 egen owneryear=group(QiuType  t)
 egen provowneryear=group(province QiuType  t)
 egen ind4year=group(ind4_adj  t)


gen lnabsG_gdp=ln(absG_gdp)

winsor2 tfp_op lnabsG_gdp lnage  finance2  lnkL rate , replace cuts(1 99) trim
*winsor2 lnRD, replace cuts(0 99) trim
drop if VMPL<0

*-----------------------------------------------------------------------------------------------
* column 2:
reghdfe lnabsG_gdp  did Llnl   Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provyear newid) cluster (ind4year)   
*-----------------------------------------------------------------------------------------------
* column 4:
reghdfe lnabsG_gdp  did Llnl   Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear newid) cluster (ind4year)   
*-----------------------------------------------------------------------------------------------
*column 6:
reghdfe lnabsG_gdp  did Llnl   Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear provyear newid) cluster (ind4year)   

*-----------------------------------------------------------------------------------------------
* column 8:
reghdfe lnabsG_gdp  did Llnl   Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provowneryear newid) cluster (ind4year)   

*-----------------------------------------------------------------------------------------------
* column 10:
reghdfe lnabsG_gdp  did Llnl   Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(ind2year provowneryear newid) cluster (ind4year)   

***************************************
*column 12(continuing firms)
capture drop n
gen n=1
bysort newid: egen tot_n=sum(n)
reghdfe lnabsG_gdp  did Llnl   Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind if tot_n==10,  ///
absorb(owneryear provyear newid) cluster (ind4year)   

*----------------------------------------------------------------------------------------------------






















**************************Table C2******************************************************
**************************Table C2******************************************************
**************************Table C2******************************************************






*--------------------------------------------------
* Part I nonexporters: Columns 1, 3, 5, 7, 9, 11
*---------------------------------------------------

cd "D:\Nanjing\2020\wage gap\Replication"   
use "labor-basic-tpu-reg-1.dta",clear




gen VMPK=capitale*(y_ind_add1/k)

drop if VMPK<0

/*
* distribution of VMPK
twoway (kdensity VMPK if VMPK<5.3, color(red)),  xtitle(VMPK) ytitle(Distribution)
graph export "D:\Nanjing\2020\wage gap\RR\results\VMPK_dist.eps",replace
*/


*1. generate capital category:
bysort id: gen indc_n=_n==1
gen m_k=k if indc_n==1
bysort id: egen M_k=max(m_k)

egen p1=pctile(M_k), p(25)
egen p2=pctile(M_k), p(50)
egen p3=pctile(M_k), p(75)
gen size_k=0
replace size_k=1 if M_k<=p1
replace size_k=2 if M_k>p1&M_k<p2
replace size_k=3 if M_k>p2&M_k<p3
replace size_k=4 if M_k>p3

 bysort t indc: egen agg_l=sum(n)
 gen l_s=n/agg_l
 
*2. generate average rental rate in each category:
bysort city ind4_adj QiuType size_k t: egen r_rate=sum(l_s*VMPK) if inv>0
*bysort county ind4_adj QiuType size_k t: egen r_rate=mean(VMPK) if inv>0


* 3. gap measured in capital:

gen gdp_def=1
replace gdp_def=1.077 if t==1999
replace gdp_def=1.077*1.085 if t==2000
replace gdp_def=1.077*1.085*1.083 if t==2001
replace gdp_def=1.077*1.085*1.083*1.091 if t==2002
replace gdp_def=1.077*1.085*1.083*1.091*1.10 if t==2003
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201 if t==2004
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201*1.114 if t==2005
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201*1.114*1.127 if t==2006
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201*1.114*1.127*1.142 if t==2007

/*
gen gdp_def=1
replace gdp_def=1.063 if t==1999
replace gdp_def=1.177 if t==2000
replace gdp_def=1.302 if t==2001
replace gdp_def=1.428 if t==2002
replace gdp_def=1.819 if t==2003
replace gdp_def=1.899 if t==2004
replace gdp_def=2.198 if t==2005
replace gdp_def=2.575 if t==2006
replace gdp_def=3.170 if t==2007
*/

gen gap_k=VMPK-r_rate
gen abs_G_k=abs(gap_k)
gen lnabs_k=log(abs_G_k)

*-----------------------------------------------------------------
gen indc=1 if d_export==0
bysort newid: egen tot_num=sum(indc)
bysort newid t: gen ini_year=_n==1
gen ini_year2=t if ini_year==1
gen diff_year=2007-ini_year2+1
bysort newid: egen max_diff=max(diff_year)
keep if max_diff==tot_num  

      
* xtset newid t
 egen provyear=group(province  t)
 egen ind2year=group(ind2_adj  t)
 egen owneryear=group(QiuType  t)
 egen provowneryear=group(province QiuType  t)
 egen ind4year=group(ind4_adj  t)


gen lnabsG_gdp=ln(absG_gdp)

winsor2 tfp_op lnabsG_gdp lnage  finance2  lnkL rate , replace cuts(1 99) trim
*winsor2 lnRD, replace cuts(0 99) trim

*----------------------------------------------------------------------------------------
*Column 1:
reghdfe lnabs_k  did  Llnl  Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provyear newid) cluster (ind4year)   
*----------------------------------------------------------------------------------------
*Column 3:
reghdfe lnabs_k  did  Llnl  Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear newid) cluster (ind4year)   
*----------------------------------------------------------------------------------------
*Column 5:
reghdfe lnabs_k  did  Llnl  Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear provyear newid) cluster (ind4year)   

*----------------------------------------------------------------------------------------
*Column 7:
reghdfe lnabs_k  did  Llnl  Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provowneryear newid) cluster (ind4year)   


*Column 9:
reghdfe lnabs_k  did  Llnl  Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(ind2year provowneryear newid) cluster (ind4year)   
*----------------------------------------------------------------------------------------
***************************************
*Column 11 (continuing firms)
capture drop n
gen n=1
bysort newid: egen tot_n=sum(n)
reghdfe lnabs_k  did  Llnl  Ltfp_op   Llnage  LlnkL  LlnRD   export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind if tot_n==10,  ///
absorb(owneryear provyear newid) cluster (ind4year)   


******************************************************************************************************



*-------------------------------------------------
* Part II (exporters): Columns 2, 4, 6, 8, 10, 12
*-------------------------------------------------

cd "D:\Nanjing\2020\wage gap\Replication"   
use "labor-basic-tpu-reg-1.dta",clear





gen VMPK=capitale*(y_ind_add1/k)

drop if VMPK<0

/*
* distribution of VMPK
twoway (kdensity VMPK if VMPK<5.3, color(red)),  xtitle(VMPK) ytitle(Distribution)
graph export "D:\Nanjing\2020\wage gap\RR\results\VMPK_dist.eps",replace
*/


*1. generate capital category:
bysort id: gen indc_n=_n==1
gen m_k=k if indc_n==1
bysort id: egen M_k=max(m_k)

egen p1=pctile(M_k), p(25)
egen p2=pctile(M_k), p(50)
egen p3=pctile(M_k), p(75)
gen size_k=0
replace size_k=1 if M_k<=p1
replace size_k=2 if M_k>p1&M_k<p2
replace size_k=3 if M_k>p2&M_k<p3
replace size_k=4 if M_k>p3

 bysort t indc: egen agg_l=sum(n)
 gen l_s=n/agg_l
 
*2. generate average rental rate in each category:
bysort city ind4_adj QiuType size_k t: egen r_rate=sum(l_s*VMPK) if inv>0
*bysort county ind4_adj QiuType size_k t: egen r_rate=mean(VMPK) if inv>0


* 3. gap measured in capital:

gen gdp_def=1
replace gdp_def=1.077 if t==1999
replace gdp_def=1.077*1.085 if t==2000
replace gdp_def=1.077*1.085*1.083 if t==2001
replace gdp_def=1.077*1.085*1.083*1.091 if t==2002
replace gdp_def=1.077*1.085*1.083*1.091*1.10 if t==2003
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201 if t==2004
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201*1.114 if t==2005
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201*1.114*1.127 if t==2006
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201*1.114*1.127*1.142 if t==2007

/*
gen gdp_def=1
replace gdp_def=1.063 if t==1999
replace gdp_def=1.177 if t==2000
replace gdp_def=1.302 if t==2001
replace gdp_def=1.428 if t==2002
replace gdp_def=1.819 if t==2003
replace gdp_def=1.899 if t==2004
replace gdp_def=2.198 if t==2005
replace gdp_def=2.575 if t==2006
replace gdp_def=3.170 if t==2007
*/

gen gap_k=VMPK-r_rate
gen abs_G_k=abs(gap_k)
gen lnabs_k=log(abs_G_k)

*-----------------------------------------------------------------

gen indc=1 if d_export==1 
bysort newid: egen tot_num=sum(indc)
bysort newid t: gen ini_year=_n==1
gen ini_year2=t if ini_year==1
gen diff_year=2007-ini_year2+1
bysort newid: egen max_diff=max(diff_year)
keep if max_diff==tot_num  

bysort newid: egen exp_max=max(export_intensity)
drop if exp_max==1         
* xtset newid t
 egen provyear=group(province  t)
 egen ind2year=group(ind2_adj  t)
 egen owneryear=group(QiuType  t)
 egen provowneryear=group(province QiuType  t)
 egen ind4year=group(ind4_adj  t)


gen lnabsG_gdp=ln(absG_gdp)

winsor2 tfp_op lnabsG_gdp lnage  finance2  lnkL rate , replace cuts(1 99) trim
*winsor2 lnRD, replace cuts(0 99) trim

*----------------------------------------------------------------------------------------
*Column 2:
reghdfe lnabs_k  did   Llnl  Ltfp_op   Llnage  LlnkL  LlnRD  export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provyear newid) cluster (ind4year)   
*----------------------------------------------------------------------------------------
*Column 4:
reghdfe lnabs_k  did   Llnl  Ltfp_op   Llnage  LlnkL  LlnRD  export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear newid) cluster (ind4year)   
*----------------------------------------------------------------------------------------
*Column 6:
reghdfe lnabs_k  did   Llnl  Ltfp_op   Llnage  LlnkL  LlnRD  export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear provyear newid) cluster (ind4year)   

*----------------------------------------------------------------------------------------
*Column 8:
reghdfe lnabs_k  did   Llnl  Ltfp_op   Llnage  LlnkL  LlnRD  export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provowneryear newid) cluster (ind4year)   

*----------------------------------------------------------------------------------------
*Column 10:
reghdfe lnabs_k  did   Llnl  Ltfp_op   Llnage  LlnkL  LlnRD  export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(ind2year provowneryear newid) cluster (ind4year)   

***************************************
*Column 12 (continuing firms)
capture drop n
gen n=1
bysort newid: egen tot_n=sum(n)
reghdfe lnabs_k  did   Llnl  Ltfp_op   Llnage  LlnkL  LlnRD  export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind if tot_n>=9,  ///
absorb(owneryear provyear newid) cluster (ind4year)   



 









